package com.grad.webstudy.dao;

import com.grad.webstudy.model.Collect;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface CollectDao {
    int deleteByPrimaryKey(Integer id);



    int insertSelective(Collect record);

    Collect selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Collect record);

    int updateByPrimaryKey(Collect record);


    /**
     * 增加收藏
     * @param record
     * @return
     */
    int insert(Collect record);


    /**
     * 查询某个用户的收藏课程
     * @param userId
     * @return
     */
    List<Collect> queryAll(int userId);


    /**
     * 删除收藏的课程
     * @param userId
     * @param courseIds
     * @return
     */
    int deleteCollects(@Param("userId") int userId, @Param("courseIds") List<String> courseIds);
}